package cn.smxy.ln.service;

import cn.smxy.ln.common.dto.LoginDto;
import cn.smxy.ln.common.lang.Result;
import cn.smxy.ln.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;

/*
 * @author ln
 * @date 2022-05-20 19:26
 *
 */
@FeignClient(value = "TPA-SPRINGCLOUD-PROVIDER-LOGIN-8020", contextId = "UserService", fallbackFactory = UserServiceFallbackFactory.class)
public interface UserService {

    @PostMapping("/user/save")
    public Object save(@Validated @RequestBody User user);

    @PostMapping("/login")
    public Result login(@Validated @RequestBody LoginDto dto);

    @GetMapping("/logout")
    public Result logout();

    @GetMapping("/user/list")
    public Result queryAll();

}
